﻿using KAKA.Domain;
using Morus;
using System.Collections.Generic;
using System.Linq;

namespace KAKA.Repository
{
    public abstract class DecoratedDictionaryRepository : IDictionaryRepository
    {
        private IDictionaryRepository InnerRepository { get; set; }

        public DecoratedDictionaryRepository(IDictionaryRepository innerRepository)
        {
            Check.Argument.IsNotNull(innerRepository, "innerRepository");

            InnerRepository = innerRepository;
        }

        public void Add(Dictionary aggregateRoot)
        {
            InnerRepository.Add(aggregateRoot);
        }

        public void Commit()
        {
            InnerRepository.Commit();
        }

        public void Dispose()
        {
            InnerRepository.Dispose();
        }

        public virtual IEnumerable<Dictionary> FindByType(string type)
        {
            return InnerRepository.FindByType(type);
        }
    }
}
